#define SOL_ALL_SAFETIES_ON 1
#include <sol/sol.hpp>

#include "string.h"

#include "./../luaQt.h"
#include "./../luaQColor.h"

namespace LuaQt{
	void open_luaQColor(sol::table& module) {
		module.set_function("NewQColor",sol::overload(
				[]() { return QColor(); }
				,[](double r, double g, double b) { return QColor(r*255,g*255,b*255); }
				,[](double r, double g, double b,double a) { return QColor(r*255,g*255,b*255,a*255); }
				,[](const QColor& c) { return c; }
				)
		);
		module.new_usertype<QColor>("QColor"
				,"red", sol::property( &QColor::red, &QColor::setRed)
				,"blue", sol::property( &QColor::blue, &QColor::setBlue)
				,"green", sol::property( &QColor::green, &QColor::setGreen)
				,"alpha", sol::property( &QColor::alpha, &QColor::setAlpha)
		);
	}
};


